/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package calculator.form;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 *
 * @author Admin
 */
public class FileSelectionControl extends JPanel implements ActionListener {

    public FileSelectionControl() {
        super();
        pathTextfield = new JTextField(20);
        selectButton = new JButton("Select");
        selectButton.addActionListener(this);
        fileChooser = new JFileChooser();
        this.add(pathTextfield);
        this.add(selectButton);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == selectButton) {
            fileChooser.showOpenDialog(null);
        }
    }
    private JButton selectButton;
    private JTextField pathTextfield;
    private JFileChooser fileChooser;

}
